﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Adams.Public.Web.Business.Web.Areas.Membership.Profile
{
    public class Index
    {
        public static Adams.Public.DataTransfer.Web.Areas.Membership.Profile.Index.PageLoad PageLoad(string token)
        {
            var input = new Adams.Public.DataTransfer.MemberInfo() {
                Token = token
            };

            var data = Api.GetData<Adams.Public.DataTransfer.Profile.GetMember>("Profile/GetMember", input);
            var data2 = Api.GetData<Adams.Public.DataTransfer.Profile.GetCreditCard>("Profile/GetCreditCard", input);

            var model = new Adams.Public.DataTransfer.Web.Areas.Membership.Profile.Index.PageLoad();
            model.Member = data.Member;
            model.CreditCard = data2.CreditCard;
            model.HasCreditCard = data2.HasCreditCard;

            return model;
        }
    }
}
